<template>
	<view class="updatename">
		<view class="top">
			<image src='../../static/businessImg/back.png'  class="topback" @click="back">
			</image> 
			<view class="topname">
				店铺名称
			</view>
		</view>
		
		<view class="updatenamecenter">
			<view class="updateinput">
				<u-input v-model="value"  :border="true" clearable/>
			</view>
			
			<view class="textesad">
				请填写您的名称~
			</view>
		</view>
		
		<view class="btn" @click="handleSubmit">
			提交
		</view>
	</view>
</template>

<script>
	import storage from '@/utils/storage.js';
	import {
		updData
	} from '@/api/gongyingshang.js'
	export default {
		data() {
			return {
				value: ''
			}
		},
		methods: {
			back() {
				uni.navigateBack({
					delta: 1
				});
			},
			
			handleSubmit(){
				updData({
					id: storage.getUserInfo().storeId,
					name: this.value
				}).then(res => {
					uni.showToast({
						icon: 'none',
						title: '修改成功'
					});
					this.back();
				})
			}
		},
		onLoad(option) {
			this.value = option.name;
		},
	}
</script>

<style scoped>

.updatename {
		width: 100%;
		min-height: 100vh;
		background: #FFFFFF;
	}

	.top {
		width: 100%;
		height: 188rpx;
		position: relative;
		background: #FFFFFF;
	}

	.topback {
		width: 16rpx;
		height: 29rpx;
		position: absolute;
		top: 106rpx;
		left: 32rpx;
	}

	.topname {
		width: 300rpx;
		height: 32rpx;
		text-align: center;
		font-family: Adobe Heiti Std;
		font-weight: normal;
		font-size: 33rpx;
		color: #222222;
		line-height: 32rpx;
		position: absolute;
		top: 104rpx;
		left: 50%;
		transform: translateX(-50%);
	}
	
	.updatenamecenter {
		width: 100%;
		padding: 0 20rpx;
		margin-top: 5rpx;
	}
	
	.btn {
		width: 709rpx;
		height: 91rpx;
		border-radius: 50rpx;
		line-height: 91rpx;
		text-align: center;
		font-family: PingFang;
		font-weight: bold;
		font-size: 29rpx;
		color: #FFFFFF;
		position: absolute;
		bottom: 19rpx;
		left: 50%;
		transform: translateX(-50%);
		background: rgb(146, 207, 56);
	}
	
	.textesad {
		font-family: Adobe Heiti Std;
		font-weight: normal;
		font-size: 25rpx;
		color: #BEC2CC;
		margin-top: 29rpx;
	}
</style>
